package com.neuedu.util;

public class PageUtil {
	
	public static final Integer DEFAULT_LENGTH = 5;
	
	public static Integer getStartIndex(Integer pagenum, Integer length) {
		if(pagenum == null || pagenum <= 0) {
			//当没有页码时，认为从头开始查询
			return 0;
		}
		if(length == null || length <= 0) {
			return (pagenum-1) * DEFAULT_LENGTH;
		}else {
			return (pagenum-1) * length;
		}
	}

}
